using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;

public class PackagerIOS : PackagerBase
{
    public override void BuildPlayer(bool export = true)
    {
        BuildAssetBundle();
        ExportXCodeProject();
    }

    private void ExportXCodeProject()
    {
        string[] levels = packagerRules.startupScenes;
        string packagePath = PreparePackageDir();

        EditorUserBuildSettings.development = Packager.DEVELOPMENT;
        EditorUserBuildSettings.connectProfiler = Packager.DEVELOPMENT;
        BuildPipeline.BuildPlayer(levels, packagePath, BuildTarget.iOS, 
            Packager.DEVELOPMENT ? 
            BuildOptions.Development | 
            BuildOptions.ConnectWithProfiler | 
            BuildOptions.AcceptExternalModificationsToPlayer :
            BuildOptions.AcceptExternalModificationsToPlayer);
    }
}
